var o = getApp();

Page({
    data: {
        school_id: 0,
        detailInfo: {},
        status: 1
    },
    onLoad: function(o) {
        if (o.scene) {
            var t = decodeURIComponent(o.scene);
            if (console.log(t), t) {
                var s = [];
                s = t.split(",");
                for (var n = 0; n < s.length; n++) {
                    var a;
                    a = s[n].split("="), console.log(a), "school_id" == a[0] && this.setData({
                        school_id: a[1]
                    });
                }
            }
        }
        this.getDetails();
    },
    getDetails: function() {
        var t = this, s = this.data.school_id, n = o.getNetAddresss("plugin.school-company.api.school");
        o._postNetWork({
            url: n,
            data: {
                school_id: s
            },
            success: function(s) {
                var n = s.data;
                if (1 != n.result) return o.tips(n.msg);
                t.setData({
                    detailInfo: n.data
                });
            }
        });
    },
    sendBtn: function() {
        var t = this, s = this.data.school_id, n = o.getNetAddresss("plugin.school-company.api.school.bind-school");
        o._postNetWork({
            url: n,
            data: {
                school_id: s
            },
            success: function(s) {
                var n = s.data;
                o.tips(n.msg), 1 == n.result && t.setData({
                    status: 2
                });
            }
        });
    },
    gotoIndex: function() {
        wx.navigateTo({
            url: "/packageG/index/index"
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});